package com.example.cluster.mapper.generator;

import com.example.cluster.mapper.po.ProjectPo;
import com.example.cluster.mapper.po.ProjectPoExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface ProjectPoMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table project
     *
     * @mbg.generated
     */
    @Delete({
        "delete from project",
        "where `project_id` = #{projectId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer projectId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table project
     *
     * @mbg.generated
     */
    @Insert({
        "insert into project (`project_id`, `name`, ",
        "`create_time`, `status`, ",
        "`user_id`, `description`)",
        "values (#{projectId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=TINYINT}, ",
        "#{userId,jdbcType=INTEGER}, #{description,jdbcType=LONGVARCHAR})"
    })
    int insert(ProjectPo row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table project
     *
     * @mbg.generated
     */
    @InsertProvider(type=ProjectPoSqlProvider.class, method="insertSelective")
    int insertSelective(ProjectPo row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table project
     *
     * @mbg.generated
     */
    @SelectProvider(type=ProjectPoSqlProvider.class, method="selectByExampleWithBLOBs")
    @Results({
        @Result(column="project_id", property="projectId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="status", property="status", jdbcType=JdbcType.TINYINT),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.INTEGER),
        @Result(column="description", property="description", jdbcType=JdbcType.LONGVARCHAR)
    })
    List<ProjectPo> selectByExampleWithBLOBs(ProjectPoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table project
     *
     * @mbg.generated
     */
    @SelectProvider(type=ProjectPoSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="project_id", property="projectId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="status", property="status", jdbcType=JdbcType.TINYINT),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.INTEGER)
    })
    List<ProjectPo> selectByExample(ProjectPoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table project
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "`project_id`, `name`, `create_time`, `status`, `user_id`, `description`",
        "from project",
        "where `project_id` = #{projectId,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="project_id", property="projectId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="status", property="status", jdbcType=JdbcType.TINYINT),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.INTEGER),
        @Result(column="description", property="description", jdbcType=JdbcType.LONGVARCHAR)
    })
    ProjectPo selectByPrimaryKey(Integer projectId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table project
     *
     * @mbg.generated
     */
    @UpdateProvider(type=ProjectPoSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(ProjectPo row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table project
     *
     * @mbg.generated
     */
    @Update({
        "update project",
        "set `name` = #{name,jdbcType=VARCHAR},",
          "`create_time` = #{createTime,jdbcType=TIMESTAMP},",
          "`status` = #{status,jdbcType=TINYINT},",
          "`user_id` = #{userId,jdbcType=INTEGER},",
          "`description` = #{description,jdbcType=LONGVARCHAR}",
        "where `project_id` = #{projectId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKeyWithBLOBs(ProjectPo row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table project
     *
     * @mbg.generated
     */
    @Update({
        "update project",
        "set `name` = #{name,jdbcType=VARCHAR},",
          "`create_time` = #{createTime,jdbcType=TIMESTAMP},",
          "`status` = #{status,jdbcType=TINYINT},",
          "`user_id` = #{userId,jdbcType=INTEGER}",
        "where `project_id` = #{projectId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(ProjectPo row);
}